package com.syj.jsxjj.ui.my.activity;

import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

import com.syj.jsxjj.R;
import com.syj.jsxjj.app.App;
import com.syj.jsxjj.base.BaseActivity;
import com.syj.jsxjj.base.PermissionsListener;
import com.syj.jsxjj.dialog.AlertFragmentDialog;
import com.syj.jsxjj.ui.my.contract.FeedBackContract;
import com.syj.jsxjj.ui.my.presenter.FeedBackPresenter;
import com.syj.jsxjj.util.ToastUtil;
import com.syj.jsxjj.util.Tool;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import butterknife.BindView;
import butterknife.OnClick;

import static com.syj.jsxjj.R.id.input_feedback;

/**
 * Created by gyl on 2017/2/15 0015.
 */

public class HelpActivity extends BaseActivity {

    @Override
    public int getLayoutId() {
        return R.layout.activity_help;
    }

    @Override
    public void initPresenter() {}

    @Override
    public void loadData() {
       mTitle.setTitle("联系客服");
    }

    @OnClick({R.id.qq_layout})
    public void onClick(View view) {
        if (Tool.isFastDoubleClick())
            return;
        switch (view.getId()) {
            case R.id.qq_layout:
                // 跳转到客服
                String qq_url = "mqqwpa://im/chat?chat_type=wpa&uin=" + "3579955909";//
                try {
                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(qq_url)));
                } catch (Exception e) {
                    ToastUtil.showToast("请确认安装了QQ客户端");
                }
                break;
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            if (getCurrentFocus() != null && getCurrentFocus().getWindowToken() != null) {
                manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
            }
        }
        return super.onTouchEvent(event);
    }

}
